﻿@using Kevin.Shop.Business.SalesManagement.Enumerations
@using RiderShop.Mobile.Common.Component
@using Kevin.Shop.Business.SalesManagement.Components.Order
@model RiderShop.Mobile.Modle.MyAccount.OrderModel
@foreach (var order in (Model.OrderList as List<OrderBasicInfo>))
{
    <tr>
        <td class="OrderNumber">订单编号：<a href="~/MyAccount/OrderDetail?orderNumber=@order.OrderNumber"  target="_blank">@order.OrderNumber</a>
        </td>
        <td colspan="4" class="OrderDate"><i class="fa fa-clock-o"></i>下单时间：@order.OrderDate</td>
    </tr>
    <tr>
        <td class="title">
            @foreach (var product in order.ProductList)
            {
                <ul class="ProductsList">
                    <li><i class="fa fa-angle-right"></i><a href="~/Product/ProductDetail?prd=@product.ProductId" target="_blank">@product.ProductName</a> <span class="pQuantity">&times; @product.Quantity</span></li>
                </ul>
            }
        </td>
        <td class="OrderTotalAmount">￥@order.OrderTotalAmount</td>
        <td class="OrdeStatus">@order.OrdeStatusName</td>
        <td class="OrderStatus">
            @if (order.ArrivePay == 1)
            { 
                <span class="btns warning"><i class="fa fa-warning"></i>货到付款</span>
            }
            else
            {
                if (@order.OrderStatus == OrderStatus.待支付)
                {
                    <a class="btns dangerous" href="~/Purchase/Payment?orderNumber=@order.OrderNumber.Trim()&orderType=1"><i class="fa fa-caret-right"></i> 去付款</a>
                }
                else if (@order.OrderStatus == OrderStatus.已付款 || @order.OrderStatus == OrderStatus.待出库
                        || @order.OrderStatus == OrderStatus.已出库 || @order.OrderStatus == OrderStatus.已发货
                        || @order.OrderStatus == OrderStatus.已收货 || @order.OrderStatus == OrderStatus.已收款
                        || @order.OrderStatus == OrderStatus.已结束)
                {
                    <span class="btns success"><i class="fa fa-check"></i> 已支付</span>
                }
                else
                {
                    <span class="btns warning"><i class="fa fa-warning"></i> 未支付</span>
                }
            }
        </td>
        <td class="OrderAction">
            <a class="btn_gray" href="~/MyAccount/OrderDetail?orderNumber=@order.OrderNumber" target="_blank"><i class="fa fa-bars"></i>订单详情</a>
            @if (@order.OrderStatus == OrderStatus.待支付 || @order.OrderStatus == OrderStatus.待确认)
            {
                <a class="btns dangerous" href="javascript:void(0)" onclick="opneCancelOrderWindow('@order.OrderNumber');" style="margin-top:5px"><i class="fa fa-times"></i>取消订单</a>
            }
        </td>
    </tr>
}